package org.tongdao.yulong.oftype;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.tongdao.yulong.oftype.dao.DemoDao;

import java.util.Map;
import java.util.function.BiConsumer;

/**
 * @Description: TODO
 * @author: 殷玉龙
 * @date: 2020年09月27日 5:53 下午
 */
public class OfTypeApplication {
  public static void main(String[] args) {
    ApplicationContext apx = new ClassPathXmlApplicationContext("basic_dl/quickstart-oftype.xml");
    Map<String, DemoDao> beansOfType = apx.getBeansOfType(DemoDao.class);
    beansOfType.forEach(new BiConsumer<String, DemoDao>() {
      @Override
      public void accept(String s, DemoDao demoDao) {
        System.out.println(s + ":" + demoDao.toString());
      }
    });
  }
}
